cmake_minimum_required(VERSION 3.21)
project(OpenGL_The_Cherno)

set(CMAKE_CXX_STANDARD 14)

include_directories(3rd/glew/include)
include_directories(3rd/glfw/include)
include_directories(src/vendor)

set(GLEW_LINK ${CMAKE_SOURCE_DIR}/3rd/glew/lib/libGLEW.a)
set(GLFW_LINK ${CMAKE_SOURCE_DIR}/3rd/glfw/lib-arm64/libglfw.3.dylib)
link_libraries(${OPENGL} ${GLEW_LINK} ${GLFW_LINK})

add_executable(OpenGL_The_Cherno
        src/Application.cpp
        src/IndexBuffer.cpp
        src/IndexBuffer.hpp
        src/Renderer.hpp
        src/Renderer.cpp
        src/VertexArray.cpp
        src/VertexArray.hpp
        src/VertexBuffer.cpp
        src/VertexBuffer.hpp
        src/VertexBufferLayout.cpp
        src/VertexBufferLayout.hpp
        src/Shader.cpp src/Shader.h
        src/vendor/stb_image/stb_image.h
        src/vendor/stb_image/stb_image.cpp
        src/Texture.h src/Texture.cpp
        src/vendor/imgui/imgui_impl_glfw_gl3.cpp
        src/vendor/imgui/imgui.cpp
        src/vendor/imgui/imgui_demo.cpp
        src/vendor/imgui/imgui_draw.cpp
        src/vendor/tests/Test.h src/vendor/tests/TestClearColor.h src/vendor/tests/TestClearColor.cpp src/vendor/tests/Test.cpp src/vendor/tests/TestTexture2D.cpp src/vendor/tests/TestTexture2D.h)


if (APPLE)
    target_link_libraries(OpenGL_The_Cherno "-framework OpenGL")
    target_link_libraries(OpenGL_The_Cherno "-framework GLUT")
endif ()